/**
 * 
 */
package edu.vanderbilt.vshare.multicast;

/**
 * class that provides a shutdown hook for gracefully exiting client applications
 * 
 * @author jedmondson
 *
 */
public class ServerShutdown extends Thread {

	/**
	 * this hook gracefully shuts down all server threads
	 */
	@Override
	public void run() {
		System.out.print ("Shutting down server...");

		SharedGlobals.shutdown.set(true);
		// block for all threads to clean up
		SharedGlobals.threadPool_.shutdown();
		
		System.out.println (" done");
		System.out.flush();

	}
}
